<template>
    <div>
        <h2>toRef 和 toRefs</h2>
    </div>
</template>
<script name="setup" lang="ts" setup>
import { toRef, toRefs,reactive } from 'vue';

const state = reactive({ count: 0, text: 'hello' });
const countRef = toRef(state, 'count');
const refs = toRefs(state); // 类型为 { count: Ref<number>, text: Ref<string> }
</script>
<style scoped lang="less"></style>